﻿if not ArmorCraft_revision then ArmorCraft_revision = {} end
ArmorCraft_revision.formulas	= ("$Revision: 209 $"):match("(%d+)")

-- Localization table
local L = LibStub("AceLocale-3.0"):GetLocale("ArmorCraft", true)

-- Global data
ArmorCraft = ArmorCraft or {}
local ACG = ArmorCraft


-- Crafts that works with ArmorCraft
ACG.SupportedCrafts = {	[L['Blacksmithing']] 	= true, 	[L['Leatherworking']]	= true,
								[L['Tailoring']] 			= true, 	[L['Engineering']] 		= true,
								[L['Jewelcrafting']] 	= true,	[L['Inscription']] 		= true,
}

-- When the class is not localized, it is on purpuse
-- Starting armour for every classes
ACG.StartingArmor = {
	MAGE			= L['Cloth'],
	PRIEST		= L['Cloth'],
	WARLOCK		= L['Cloth'],
	DRUID			= L['Leather'],
	ROGUE			= L['Leather'],
	HUNTER		= L['Leather'],
	SHAMAN		= L['Leather'],
	PALADIN		= L['Mail'],
	WARRIOR		= L['Mail'],
	DEATHKNIGHT	= L['Plate'],
}

-- The armor types may be starting or best armor
ACG.ArmorTypes = {L['Cloth'], L['Leather'], L['Mail'], L['Plate']};


--	Best armour achiveable
ACG.BestArmor 	= {
	HUNTER	= L['Mail'],
	SHAMAN	= L['Mail'],
	PALADIN	= L['Plate'],
	WARRIOR	= L['Plate'],
}

-- Reverse translation for when we need an English word and all we have is a localizaed one
ACG.toEnglish = {
	[L['DEATHKNIGHT']]	= 'DEATHKNIGHT',
	[L['DRUID']]			= 'DRUID',
	[L['HUNTER']]			= 'HUNTER',
	[L['MAGE']]				= 'MAGE',
	[L['PALADIN']]			= 'PALADIN',
	[L['PRIEST']]			= 'PRIEST',
	[L['ROGUE']]			= 'ROGUE',
	[L['SHAMAN']]			= 'SHAMAN',
	[L['WARLOCK']]			= 'WARLOCK',
	[L['WARRIOR']]			= 'WARRIOR',
}


-- Armor location names and IDs
-- A forth column tex is added during the initialisation and countain the texture.
ACG.ItemLocation = {				-- Paperdoll slot names					AC_FrameTemplate ID  Paperdoll slot ID
    [INVTYPE_HEAD] =				{slot='HeadSlot',											ID=1,		SlotID=1};
    [INVTYPE_SHOULDER] =		{slot='ShoulderSlot',									ID=2,		SlotID=3};
    [INVTYPE_CLOAK] =			{slot='BackSlot',											ID=3,		SlotID=15};
    [INVTYPE_CHEST] =			{slot='ChestSlot',										ID=4,		SlotID=5};
    [INVTYPE_WRIST] =			{slot='WristSlot',										ID=5,		SlotID=9};
    [INVTYPE_HAND] =				{slot='HandsSlot',										ID=6,		SlotID=10};
    [INVTYPE_WAIST] =			{slot='WaistSlot',										ID=7,		SlotID=6};
    [INVTYPE_LEGS] =				{slot='LegsSlot',											ID=8,		SlotID=7};
    [INVTYPE_FEET] =				{slot='FeetSlot',											ID=9,		SlotID=8};
    [INVTYPE_WEAPONMAINHAND]=	{slot='MainHandSlot',slot1='SecondaryHandSlot',	ID=10,	SlotID=16};
    [INVTYPE_WEAPONOFFHAND] =	{slot='SecondaryHandSlot', 							ID=11,	SlotID=17};
    [INVTYPE_HOLDABLE]=			{slot='SecondaryHandSlot',											SlotID=17};
    [INVTYPE_RANGED] =			{slot='RangedSlot',										ID=12,	SlotID=18};
    [INVTYPE_FINGER] =			{slot='Finger0Slot',	slot1='Finger1Slot',			ID=13,	SlotID=11};
    [L['Finger 2']] =			{slot='Finger1Slot',										ID=14,	SlotID=12};
    [INVTYPE_NECK] =				{slot='NeckSlot',											ID=15,	SlotID=2};
    [INVTYPE_TRINKET] =			{slot='Trinket0Slot',slot1='Trinket1Slot', 		ID=16,	SlotID=13};
    [L['Trinket 2']] =			{slot='Trinket1Slot', 									ID=17,	SlotID=14};
};

--[[ from GlobalStrings.lua
INVTYPE_2HWEAPON = "Two-Hand"; -- Two-hand type
INVTYPE_AMMO = "Ammo";
INVTYPE_BAG = "Bag"; -- Bag type
INVTYPE_BODY = "Shirt"; -- Body type
INVTYPE_CHEST = "Chest"; -- Chest type
INVTYPE_CLOAK = "Back"; -- Cloak type
INVTYPE_FEET = "Feet"; -- Feet type
INVTYPE_FINGER = "Finger"; -- Finger type
INVTYPE_HAND = "Hands"; -- Hands type
INVTYPE_HEAD = "Head"; -- Head type
INVTYPE_HOLDABLE = "Held In Off-hand"; -- Holdable type
INVTYPE_LEGS = "Legs"; -- Legs type
INVTYPE_NECK = "Neck"; -- Neck type
INVTYPE_QUIVER = "Quiver";
INVTYPE_RANGED = "Ranged"; -- Ranged type
INVTYPE_RANGEDRIGHT = "Ranged";
INVTYPE_RELIC = "Relic";
INVTYPE_ROBE = "Chest"; -- Robe type
INVTYPE_SHIELD = "Off Hand"; -- Shield type
INVTYPE_SHOULDER = "Shoulder"; -- Shoulder type
INVTYPE_TABARD = "Tabard"; -- Tabard type
INVTYPE_THROWN = "Thrown";
INVTYPE_TRINKET = "Trinket"; -- Trinket type
INVTYPE_WAIST = "Waist"; -- Waist type
INVTYPE_WEAPON = "One-Hand"; -- One-hand type, either hand
INVTYPE_WEAPONMAINHAND = "Main Hand"; -- One-hand type, main hand
INVTYPE_WEAPONMAINHAND_PET = "Main Attack";
INVTYPE_WEAPONOFFHAND = "Off Hand"; -- One-hand type, off hand
INVTYPE_WRIST = "Wrist"; -- Wrist type
]]--

-- Default formulas
ACG.DefaultFormulas = {
	-- Inspired by http://elitistjerks.com/f47/t36638-death_knight_pve_dps/
	[L['Death Knight : Unholy']]
						= "7.56*MELEEDPS+ATTACKPOWER+2.48*STR+2.47*CR_HIT+.54*APR+1.39*CR_EXPERTISE+1.12*CR_CRIT+.62*CR_HASTE+.1*AC+.35*AGI+.5*STA+.07*CR_DODGE+.07*CR_PARRY+.05*CR_DEFENSE+.03*BLOCKVALUE+.05*CR_BLOCK+1.4*BLUE+2.8*RED+2.3*YELLOW+12*META",
	[L['Death Knight : Blood']]
						= "9.89*MELEEDPS+ATTACKPOWER+2.89*STR+2.51*CR_HIT+2.75*APR+2.47*CR_EXPERTISE+1.56*CR_CRIT+.5*CR_HASTE+.03*AC+1.37*AGI+.5*STA+.07*CR_DODGE+.07*CR_PARRY+.05*CR_DEFENSE+.03*BLOCKVALUE+.05*CR_BLOCK+(6*2.89+6*1.37)*BLUE+16*2.89*RED+(8*2.89+8*2.51)*YELLOW+12*META",
	[L['Death Knight : Frost']]
						= "10.36*MELEEDPS+ATTACKPOWER+2.37*STR+2.4*CR_HIT+.76*APR+1.25*CR_EXPERTISE+1.19*CR_CRIT+.5*CR_HASTE+.1*AC+.35*AGI+.5*STA+.07*CR_DODGE+.07*CR_PARRY+.05*CR_DEFENSE+.03*BLOCKVALUE+.05*CR_BLOCK+1.4*BLUE+2.8*RED+2.3*YELLOW+12*META",

	[L['Druid Feral DPS']]
						= "AGI*2.6+STR*2.4+CR_EXPERTISE*1.6+CR_CRIT*1.55+CR_HIT*1.55+ATTACKPOWER+STA*.3+SPI*.25+CR_HASTE*1.37+AC/20",
	-- Based on http://elitistjerks.com/f73/t49702-feralbynight_cat_bear_simulation_tool/
	-- http://www.wowhead.com/?items=3&filter=qu=3;ub=11;cr=123;crs=3;crv=0;gm=3;wt=114:21:20:96:119:117:103:97:77;wtv=1.49:1.42:1.31:1.18:1.17:1.17:1.08:0.66:0.55
	[L['Druid FbN Feral DPS']]
						= "1.49*APR+1.42*AGI+.66*ATTACKPOWERFERAL+1.31*STR+1.18*CR_CRIT+1.17*CR_HIT+1.17*CR_EXPERTISE+1.08*CR_HASTE+.55*ATTACKPOWER+.3*STA+.05*AC+16*1.49*RED+(8*1.42+8*1.18)*YELOW+(6*1.42+6*1.31)*BLUE",
	-- http://www.wowhead.com/?items=3&filter=qu=3;ub=11;cr=123;crs=3;crv=0;gm=3;wt=21:22:45:42:117:41:20:109:97:115:77:96:119:114:103;wtv=2.83:2.27:2.23:2.1:1.52:1.19:0.3:0.17:0.15:0.14:0.13:0.11:0.07:0:-0.01
	[L['Druid FbN Tank Points']]
						= ".13*ATTACKPOWER+.15*ATTACKPOWERFERAL+2.83*AGI+0.3*STR+0.11*CR_CRIT-.01*CR_HASTE+0.07*CR_HIT+1.52*CR_EXPERTISE+0*APR+2.1*CR_DEFENSE+2.23*CR_DODGE+1.19*AC+.17*ARMOR_BONUS+2.27*STA+.14*HEALTH+24*BLUE+(8*2.83+12)*RED+(8*3.1+12)*YELLOW",
	-- http://www.wowhead.com/?items=4&filter=sl=5:8:10:1:7:3:6:9;ub=11;cr=123;crs=3;crv=0;gm=3;gb=1;wt=21:22:45:42:117:41:20:119:96:97:114:77:103:109:115;wtv=128.9:100:98:92:81.5:52.3:24.9:18.1:17.4:12.6:12.6:10.5:8.9:7.4:6.1
	[L["Druid FbN Night's Choise"]]
						= ".11*ATTACKPOWER+.13*ATTACKPOWERFERAL+1.29*AGI+.25*STR+.12*CR_CRIT+.09*CR_HASTE+.18*CR_HIT+.82*CR_EXPERTISE+.13*APR+.92*CR_DEFENSE+.98*CR_DODGE+.52*AC+.07*ARMOR_BONUS+STA+.06*HEALTH+24*BLUE+(8*1.29+12)*RED+(8*.92+12)*YELLOW",
	-- http://elitistjerks.com/f73/t37578-restoration_itemization/p9/#post1045397
	[L['Druid Resto']]
						= "MANAREG+.66*SPELLPOWER+.46*SPI+.52*INT+.14*CR_HASTE+.1*CR_CRIT+(16*.52)*YELLOW+(8*.52+8*.46)*BLUE+(.46*6+.52*6)*RED",
	-- http://elitistjerks.com/f73/t59457-moonkin_beginner_guide_updated_3_1_2_a/
	-- http://www.wowhead.com/?items&filter=ub=11;gm=3;gb=1;wt=119:123:103:96:23:24:61:77;wtv=2:1.3:1.2:0.8:.5:0.4:0.1:-100
	[L['Druid Boomkin']]
						= "2*CR_HIT+1.3*SPELLPOWER+1.2*CR_HASTE+.8*CR_CRIT+.5*INT+.4*SPI+.1*MANAREG+(16*2)*YELLOW+(8*2+8*.4)*BLUE+(19*1.3)*RED+(21*.8+30)*META",
	[L['Mage']]
						= "INT+.1*SPI+.1*STA+.23*CR_CRIT+.534*CR_HIT+.267*CR_HASTE+.359*SPELLPOWER+.05*CR_RESILIENCE+4.2*BLUE+9*.359*RED+8*YELLOW+14*META",
	[L['Mage Wand']]
						= "WANDDPS*.25+INT+.1*SPI+.1*STA+.23*CR_CRIT+.534*CR_HIT+.267*CR_HASTE+.359*SPELLPOWER+.05*CR_RESILIENCE+4.2*BLUE+9*.359*RED+8*YELLOW+14*META",
	[L['Mage Fire']]
						= "INT+.1*SPI+.1*STA+.23*CR_CRIT+.506*CR_HIT+.345*CR_HASTE+.361*(SPELLPOWER+FIREDMG)+.05*CR_RESILIENCE+9*.361*RED+8*YELLOW+14*META",
	[L['Mage Frost']]
						= "INT+.1*SPI+.1*STA+.23*CR_CRIT+.575*CR_HIT+.419*CR_HASTE+.411*(SPELLPOWER+FROSTDMG)+.05*CR_RESILIENCE+9*.411*RED+8*YELLOW+14*META",
	[L['Mage Arc']]
						= "INT+.1*SPI+.1*STA+.23*CR_CRIT+.667*CR_HIT+.219*CR_HASTE+.445*(SPELLPOWER+ARCANEDMG)+.05*CR_RESILIENCE+9*.445*RED+8*YELLOW+14*META",
	-- Base on http://dwarfpriest.com/2008/11/07/weighing-priest-healing-stats/
	[L['Holy Priest']]
						= "SPELLPOWER*.6+SPI*.54+INT*.74+CR_CRIT*.15+CR_HASTE*.4+MANAREG+STA*.1+BLUE*10.24+RED*11.4+YELLOW*11.84+65.54*META",
	[L['Holy Priest Wand']]
						= "WANDDPS/10+SPELLPOWER*.6+SPI*.54+INT*.74+CR_CRIT*.15+CR_HASTE*.4+MANAREG+STA*.1+BLUE*10.96+RED*11.4+YELLOW*11.84+65.54*META",
	-- Based on http://www.shadowpriest.com/viewtopic.php?f=14&t=16224
	[L['Shadow Priest']]
						= "math.max(SHADOWDMG,SPELLPOWER)+CR_CRIT*.77+CR_HASTE*.79+SPI+.23+INT*.39+CR_HIT*1.14+MANAREG*.2+BLUE*7.4+RED*19+YELLOW*18.24+META*21.8",
	[L['Shadow Priest Wand']]
						= "WANDDPS*.25+math.max(SHADOWDMG,SPELLPOWER)+CR_CRIT*.77+CR_HASTE*.79+SPI+.23+INT*.39+CR_HIT*1.14+MANAREG*.2+BLUE*7.4+RED*19+YELLOW*18.24+META*21.8",
	[L['Hunter']]
						= ".01*AC+.5*STR+AGI+.5*STA+1.15*CR_HIT+.85*CR_CRIT+.5*ATTACKPOWER+1.15*CR_EXPERTISE+CR_HASTE+.1*APR+.01*CR_RESILIENCE+.01*CR_DODGE+BLUE*7+RED*9+YELLOW*9+META*40",
	[L['Hunter Range']]
						= "RANGEDPS*7+.01*AC+.5*STR+AGI+.5*STA+1.15*CR_HIT+.85*CR_CRIT+.5*ATTACKPOWER+1.15*CR_EXPERTISE+CR_HASTE+.1*APR+.01*CR_RESILIENCE+.01*CR_DODGE+BLUE*7+RED*9+YELLOW*9+META*40",
	-- Inspired by http://pawnmod.trenchrats.com/viewtopic.php?t=61
	[L['Paladin']]
						= ".9*MELEEDPS+.1*AC+1.5*STR+.6*AGI+.5*STA+.75*INT+.75*CR_HIT+.6*CR_CRIT+.75*ATTACKPOWER+1.15*CR_EXPERTISE+.8*CR_HASTE+.15*APR+.1*CR_RESILIENCE+.07*CR_DODGE+.07*CR_PARRY+.05*CR_DEFENSE+.7*CR_CRIT+.75*CR_HIT+.8*SPELLPOWER+.3*MANAREG+.03*BLOCKVALUE+.05*CR_BLOCK+1.4*BLUE+2.8*RED+2.3*YELLOW+12*META",
	-- Rogue stuff, mostly from http://shadowpanther.net/
	[L['Rogue Main Hand MAEP']]
						= ".001*AC+.55*STR+1.1*AGI+.01*STA+1.15*CR_HIT+.9*CR_CRIT +.5*ATTACKPOWER +1.25*CR_EXPERTISE+CR_HASTE   +.15*APR+.001*CR_RESILIENCE+.001*CR_DODGE+7.59*BLUE+13.2*RED +12.6*YELLOW+40*META+3*MELEEDPS+1.75*MELEEAVG_DMG",
	[L['Rogue Dagger MAEP']]
						= ".001*AC+.55*STR+1.1*AGI+.01*STA+1.15*CR_HIT+.9*CR_CRIT +.5*ATTACKPOWER +1.25*CR_EXPERTISE+CR_HASTE   +.15*APR+.001*CR_RESILIENCE+.001*CR_DODGE+7.59*BLUE+13.2*RED +12.6*YELLOW+40*META+3*MELEEDPS+2.5*MELEEAVG_DMG",
   [L['Rogue Off Hand MAEP']]
   					= ".001*AC+.55*STR+1.1*AGI+.01*STA+1.15*CR_HIT+.9*CR_CRIT +.5*ATTACKPOWER +1.25*CR_EXPERTISE+CR_HASTE   +.15*APR+.001*CR_RESILIENCE+.001*CR_DODGE+7.59*BLUE+13.2*RED +12.6*YELLOW+40*META+8*OH_SPEED_COEF+2*MELEEDPS",
	[L['Rogue Main Hand AEP']]
						= ".001*AC+.55*STR+1.1*AGI+.01*STA+1.15*CR_HIT+.9*CR_CRIT +.5*ATTACKPOWER +1.25*CR_EXPERTISE+CR_HASTE   +.15*APR+.001*CR_RESILIENCE+.001*CR_DODGE+7.59*BLUE+13.2*RED +12.6*YELLOW+40*META+1*MELEEDPS+2.5*MELEEAVG_DMG",
	[L['Rogue Dagger AEP']]
						= ".001*AC+.55*STR+1.1*AGI+.01*STA+1.15*CR_HIT+.9*CR_CRIT +.5*ATTACKPOWER +1.25*CR_EXPERTISE+CR_HASTE   +.15*APR+.001*CR_RESILIENCE+.001*CR_DODGE+7.59*BLUE+13.2*RED +12.6*YELLOW+40*META+1*MELEEDPS+3.6*MELEEAVG_DMG",
   [L['Rogue Off Hand AEP']]
   					= ".001*AC+.55*STR+1.1*AGI+.01*STA+1.15*CR_HIT+.9*CR_CRIT +.5*ATTACKPOWER +1.25*CR_EXPERTISE+CR_HASTE   +.15*APR+.001*CR_RESILIENCE+.001*CR_DODGE+7.59*BLUE+13.2*RED +12.6*YELLOW+40*META+8*OH_SPEED_COEF+2*MELEEDPS",

	-- From http://elitistjerks.com/f47/t20765-shaman_enhancement/ and http://theorycraft.narod.ru/
	[L['Shaman AEP']]
						= "5.9*MELEEDPS+ATTACKPOWER+1.7*CR_CRIT+3.1*CR_HIT+2.6*CR_EXPERTISE+1.3*CR_HASTE+.8*APR+.9*SPELLPOWER+1.1*STR+1.7*AGI+1.7*INT+.1*AC+.4*STA+.1*CR_RESILIENCE+.1*CR_DODGE+(1.1*6+1.7*6+1.7*6)*BLUE+2.6*16*RED+3.1*16*YELLOW+(21*1.7+50)*META",
	[L['Shaman OH AEP']]
						= "2.5*MELEEDPS+ATTACKPOWER+1.7*CR_CRIT+3.1*CR_HIT+2.6*CR_EXPERTISE+1.3*CR_HASTE+.8*APR+.9*SPELLPOWER+1.1*STR+1.7*AGI+1.7*INT+.1*AC+.4*STA+.1*CR_RESILIENCE+.1*CR_DODGE+(1.1*6+1.7*6+1.7*6)*BLUE+2.6*16*RED+3.1*16*YELLOW+(21*1.7+50)*META",

--9.03*DPS*WEAPON_SPEED/2.6+.1*AC+2*STR+.99*AGI+.25*STA+1.51*CR_HIT+1.12*CR_CRIT+ATTACKPOWER+1.62*CR_EXPERTISE+0.9*CR_HASTE+.11*APR+.1*CR_RESILIENCE+.1*CR_DODGE+10*BLUE+16*RED+11.76*YELLOW+META*40
--3.7*DPS*WEAPON_SPEED/2.6 +.1*AC+2*STR+.99*AGI+.25*STA+1.51*CR_HIT+1.12*CR_CRIT+ATTACKPOWER+1.62*CR_EXPERTISE+0.9*CR_HASTE+.11*APR+.1*CR_RESILIENCE+.1*CR_DODGE+10*BLUE+16*RED+11.76*YELLOW+META*40

   -- Inspired by http://pawnmod.trenchrats.com/viewtopic.php?t=23
   [L['Warrior Fury']]
   					= "7*MELEEDPS+.01*AC+STR+.4*AGI+.25*STA+.5*CR_HIT+.6*CR_CRIT+.5*ATTACKPOWER+1.15*CR_EXPERTISE+.8*CR_HASTE+.14*APR+.1*CR_RESILIENCE+.1*CR_DODGE+BLUE*4+RED*8+YELLOW*6.3+META*23",
   -- Inspired by http://www.wowmb.net/forums/showthread.php?t=15357
   -- and http://elitistjerks.com/f80/t37900-dots_you_affliction_warlock_thread/
   -- This is an affliction spec
   -- ( Pawn: v1: "Warlock": Intellect=0.27, RedSocket=38, FireSpellDamage=0.25, CritRating=0.89, ShadowSpellDamage=1.7, MetaSocket=46.76, Mp5=0.3, HasteRating=1.37, HitRating=1.5, BlueSocket=23.3, YellowSocket=40.6, SpellPower=2, Spirit=0.66, Stamina=0.16 )
	[L['Warlock']]	= "2*SPELLPOWER+1.5*CR_HIT+.16*STA+.89*CR_CRIT+1.37*CR_HASTE+.27*INT+.05*SPELLPEN+.05*CR_RESILIENCE+.66*SPI+.3*MANAREG+23.3*BLUE+38*RED+40.6*YELLOW+46.76*META+.1*WANDDPS",
	--                .25*DPS+.95*SHADOWDMG+SPELLPOWER+.65*CR_HIT+.85*STA+.5*CR_CRIT+.5*CR_HASTE+.4*INT+.2*SPELLPEN+.1*CR_RESILIENCE+.1*SPI+10*BLUE+16*RED+11.76*YELLOW+META*15
}

-- Default formula to use
ACG.DefaultFormulasToUse = {
	DEATHKNIGHT			= { [DEFAULT] 							= L['Death Knight : Unholy'] },
	DRUID					= { [DEFAULT] 							= L['Druid Feral DPS'] },
	HUNTER				= { [DEFAULT] 							= L['Hunter'],
								 ["INVTYPE_RANGED"]				= L['Hunter Range'],
								 ["INVTYPE_RANGEDRIGHT"]		= L['Hunter Range'],
	},
	MAGE 					= { [DEFAULT] 							= L['Mage'],
								 ["INVTYPE_RANGEDRIGHT"]		= L['Mage Wand'],
	},
	PALADIN				= { [DEFAULT] 							= L['Paladin'] },
	PRIEST				= { [DEFAULT] 							= L['Shadow Priest'],
								 ["INVTYPE_RANGEDRIGHT"]		= L['Shadow Priest Wand'],
	},
	ROGUE					= { [DEFAULT] 							= L['Rogue Main Hand AEP'],
--								 ["INVTYPE_WEAPONMAINHAND"]	= L['Rogue Main Hand AEP'],
								 ["INVTYPE_WEAPONOFFHAND"]		= L['Rogue Off Hand AEP'],
	},
	SHAMAN				= { [DEFAULT] 							= L['Shaman AEP'],
								 ["INVTYPE_WEAPONOFFHAND"]		= L['Shaman OH AEP'],
	},
	WARLOCK				= { [DEFAULT] 							= L['Warlock'] },
	WARRIOR				= { [DEFAULT] 							= L['Warrior Fury'] },
}

-- Mapping of indicating what level is needed for each class to use a particular type of item
-- 999 = will never be able to use it
ACG.CanUse = {
	DEATHKNIGHT = {
								-- SubType       				MinLevel
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 1,
								[L['Plate']]					= 1,
								[L['Librams']]					= 999,
								[L['Idols']]					= 1,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 1,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 1,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 1,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 1,
								[L['Two-Handed Maces']]		= 1,
								[L['Two-Handed Swords']]	= 1,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	DRUID = {
								-- SubType       		MinLevel
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 999,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 1,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 999,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 1,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 999,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 999,
								[L['Two-Handed Axes']]		= 999,
								[L['Two-Handed Maces']]		= 1,
								[L['Two-Handed Swords']]	= 999,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	HUNTER = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 40,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 1,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 1,
								[L['One-Handed Maces']]		= 999,
								[L['Polearms']]				= 1,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 1,
								[L['Two-Handed Maces']]		= 999,
								[L['Two-Handed Swords']]	= 1,
								[L['Bows']]						= 1,
								[L['Crossbows']]				= 1,
								[L['Guns']]						= 1,
								[L['Thrown']]					= 1,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	MAGE = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 999,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 999,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 999,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 999,
								[L['One-Handed Maces']]		= 999,
								[L['Polearms']]				= 999,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 999,
								[L['Two-Handed Maces']]		= 999,
								[L['Two-Handed Swords']]	= 999,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 1,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	PALADIN = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 1,
								[L['Mail']]						= 1,
								[L['Plate']]					= 40,
								[L['Librams']]					= 1,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 1,
								[L['Daggers']]					= 999,
								[L['Fist Weapons']]			= 999,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 20,
								[L['Staves']]					= 999,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 1,
								[L['Two-Handed Maces']]		= 1,
								[L['Two-Handed Swords']]	= 1,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	PRIEST = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 999,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 999,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 999,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 999,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 999,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 999,
								[L['Two-Handed Axes']]		= 999,
								[L['Two-Handed Maces']]		= 999,
								[L['Two-Handed Swords']]	= 999,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 1,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	ROGUE = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 999,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 999,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 1,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 999,
								[L['Staves']]					= 999,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 999,
								[L['Two-Handed Maces']]		= 999,
								[L['Two-Handed Swords']]	= 999,
								[L['Bows']]						= 1,
								[L['Crossbows']]				= 1,
								[L['Guns']]						= 1,
								[L['Thrown']]					= 1,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	SHAMAN = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 1,
								[L['Mail']]						= 40,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 1,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 1,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 1,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 999,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 999,
								[L['Two-Handed Axes']]		= 20,
								[L['Two-Handed Maces']]		= 20,
								[L['Two-Handed Swords']]	= 999,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	WARLOCK = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 999,
								[L['Shields']] 				= 999,
								[L['Mail']]						= 999,
								[L['Plate']]					= 999,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 999,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 999,
								[L['One-Handed Maces']]		= 999,
								[L['Polearms']]				= 999,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 999,
								[L['Two-Handed Maces']]		= 999,
								[L['Two-Handed Swords']]	= 999,
								[L['Bows']]						= 999,
								[L['Crossbows']]				= 999,
								[L['Guns']]						= 999,
								[L['Thrown']]					= 999,
								[L['Wands']]					= 1,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
	WARRIOR = {
							[L['Armor']] = {
								[L['Cloth']] 					= 1,
								[L['Leather']] 				= 1,
								[L['Shields']] 				= 1,
								[L['Mail']]						= 1,
								[L['Plate']]					= 40,
								[L['Librams']]					= 999,
								[L['Idols']]					= 999,
								[L['Totems']]					= 999,
								[L['Held In Off-hand']]		= 1,
								[L['Miscellaneous']]			= 1,
					    	},
							[L['Weapon']] = {
								[L['One-Handed Axes']]		= 1,
								[L['Daggers']]					= 1,
								[L['Fist Weapons']]			= 1,
								[L['One-Handed Maces']]		= 1,
								[L['Polearms']]				= 20,
								[L['Staves']]					= 1,
								[L['One-Handed Swords']]	= 1,
								[L['Two-Handed Axes']]		= 1,
								[L['Two-Handed Maces']]		= 1,
								[L['Two-Handed Swords']]	= 1,
								[L['Bows']]						= 1,
								[L['Crossbows']]				= 1,
								[L['Guns']]						= 1,
								[L['Thrown']]					= 1,
								[L['Wands']]					= 999,
								[L['Fishing Poles']]			= 1,
								[L['Miscellaneous']]			= 1,
					    	},
	},
}

-- Mapping indicating in what slotID a particular inventory type can be equiped
-- see http://www.wowwiki.com/ItemEquipLoc
ACG.EquipWhere = {
--	["INVTYPE_AMMO"]				= {0},
	["INVTYPE_HEAD"]           = {1},
	["INVTYPE_NECK"]				= {2},
	["INVTYPE_SHOULDER"]			= {3},
--	["INVTYPE_BODY"]				= {4},
	["INVTYPE_CHEST"]				= {5},
	["INVTYPE_ROBE"]				= {5},
	["INVTYPE_WAIST"]				= {6},
	["INVTYPE_LEGS"]				= {7},
	["INVTYPE_FEET"]				= {8},
	["INVTYPE_WRIST"]				= {9},
	["INVTYPE_HAND"]				= {10},
	["INVTYPE_FINGER"]			= {11,12},
	["INVTYPE_TRINKET"]			= {13,14},
	["INVTYPE_CLOAK"]				= {15},
	["INVTYPE_WEAPON"]			= {16,17},
	["INVTYPE_SHIELD"]			= {17},
	["INVTYPE_2HWEAPON"]			= {16},
	["INVTYPE_WEAPONMAINHAND"]	= {16},
	["INVTYPE_WEAPONOFFHAND"]	= {17},
	["INVTYPE_HOLDABLE"]			= {17},
	["INVTYPE_RANGED"]			= {18},
	["INVTYPE_THROWN"]			= {18},
	["INVTYPE_RANGEDRIGHT"]		= {18},
	["INVTYPE_RELIC"]				= {18},
--	"INVTYPE_TABARD"				= {19},
--	"INVTYPE_BAG"					= {20,21,22,23},
--	"INVTYPE_QUIVER"  			= {20,21,22,23},
}

--[[
ArmorCraft_SlotName = {
	[1]	= 'Head',
	[2]	= 'Neck',
	[3]	= 'Shoulder',
	[5]	= 'Chest',
	[6]	= 'Waist',
	[7]	= 'Legs',
	[8]	= 'Feet',
	[9]	= 'Wrist',
	[10]	= 'Hands',
	[11]	= 'Finger',
	[12]	= 'Finger',
	[13]	= 'Trinket',
	[14]	= 'Trinket',
	[15]	= 'Back',
	[16]	= 'Main Hand',
	[17]	= 'Off Hand',
	[18]	= 'Ranged',
}
]]--

-- Shorter descriptions
ACG.ShortDesc = {
	[L['Held In Off-hand']]		= L['Off Hand'],
	[L['One-Handed Axes']]		= L['1-H Axes'],
	[L['One-Handed Maces']]		= L['1-H Maces'],
	[L['One-Handed Swords']]	= L['1-H Swords'],
	[L['Two-Handed Axes']]		= L['2-H Axes'],
	[L['Two-Handed Maces']]		= L['2-H Maces'],
	[L['Two-Handed Swords']]	= L['2-H Swords'],
}
